package package1;

public class Test {
	public static void main(String[] args) {
		
	}
    public static String formatString (String str, char[] arg) {
        // write code here
        StringBuffer ret = new StringBuffer();
        int index = 0;
        int i = 0;
        while(i < str.length()) {
            char ch = str.charAt(i);
            if(Character.isLetter(ch)) {
                ret.append(ch);
                i++;
            } else {
                ret.append(arg[index++]);
                i += 2;
            }
        }
        for(int j = index; j < arg.length; j++) {
            ret.append(arg[j]);
        }
        return ret.toString();
    }
	/*
	 * public static void main(String[] args) { Solution3 s = new Solution3();
	 * TreeNode root = s.createTree(); int ret = s.widthOfBinaryTree(root);
	 * System.out.println(ret);
	 * 
	 * }
	 */
}
